#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "kylin-activation.h"
#include "text-i18n.h"

/*
 * kylin_activation_print_result_message, print message according to result number
 */
extern void kylin_activation_print_result_message(int result);

int main(int argc, char** argv)
{
	int result;
	char* serial = NULL;

	setlocale(LC_MESSAGES, "");
	bindtextdomain (PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);
	bind_textdomain_codeset(PACKAGE, "utf8");

	serial = kylin_activation_get_serial_number(&result);
	if(result != NO_ERROR)
		kylin_activation_print_result_message(result);
	else
	{
		if(serial)
		{
			printf("%s\n", serial);
			free(serial);
		}
	}

	exit(result);
}
